/**
 * @file filter
 * @author liaoxuezhi@baidu.com
 */
/* eslint fecs-indent: [0, "space", 2, 2] */

import * as React from 'react';
import {
  Component,
  PropTypes
} from 'react';
import {Renderer, render} from './renderer';

@Renderer({
  name: 'filter',
  desc: '条件过滤容器',
  test: /(^|\/)filter$/
})
export default class Filter extends Component {
  static propTypes = {
    className: PropTypes.string,
    title: PropTypes.string,
    mode: PropTypes.string
  };

  static defaultProps = {
    title: '条件查询',
    mode: 'inline',
    submitText: '搜索'
  };

  render() {
    const {
      $path
    } = this.props;

    return render(`${$path}/panel-form`, this.props, {
      type: 'form'
    });
  }
}
